import React, {JSX} from 'react';
import {TouchableOpacity, StyleSheet, ViewStyle, StyleProp} from 'react-native';
import {BasicText} from '../text';
import { normalize } from '../../utils/adapter';

type Props = {
  text: string;
  touchStyle?: StyleProp<ViewStyle>;
  textStyle?: StyleProp<ViewStyle>;
  onPress?: () => void;
};

export default function ({
  text,
  touchStyle = {backgroundColor: '#FF685A'},
  textStyle,
  onPress,
}: Props): JSX.Element {
  return (
    <TouchableOpacity
      style={[styles.btn_container, {...(touchStyle as object)}]}
      onPress={onPress}>
      <BasicText
        color="#fff"
        fontSize={normalize(16)}
        fontWeight={'bold'}
        style={textStyle}>
        {text}
      </BasicText>
    </TouchableOpacity>
  );
}

const styles = StyleSheet.create({
  btn_container: {
    height: normalize(49),
    borderRadius: normalize(26),
    justifyContent: 'center',
    alignItems: 'center',
  },
});
